<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="author" content="Laurence-042">
    
    
    
    
    
    
    <title>DFS,BFS学习笔记 | Laurence</title>
    <link href=”https://laurence-042.github.io“ rel=”prefetch” />

    <link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/aos.css">
<link rel="stylesheet" href="/css/style.css">
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/aos.js"></script>
    <script src="/js/highslide/highslide-full.min.js"></script>
    <link rel="stylesheet" href="/js/highslide/highslide.css">
    <style type="text/css">
        @media (max-width: 768px) {
            body {
                background-color: #f0f0f0;
                background: url('/imgs/xsbg.jpg');
                background-attachment: fixed;
            }
        }
    </style>
    
    <!--<script type="text/javascript">
      if (document.images) {
        var avatar = new Image();
        avatar.src = '/imgs/dr.png'
        var previews = 'http://bing.ioliu.cn/v1/rand'.split(',')
        var previewsPreLoad = []
        for(var i = 0; i < length; i++) {
          previewsPreLoad.push(new Image())
          previewsPreLoad[previewsPreLoad.length - 1].src = '/imgs/preview' + previews[i]
        }
      }
    </script>-->

    <!--highlight.js-->
    <link rel="stylesheet" href="//cdn.bootcss.com/highlight.js/9.2.0/styles/github.min.css">
    <script src="//cdn.bootcss.com/highlight.js/9.2.0/highlight.min.js"></script>
</head>
<body>
    <!-- 背景轮播图功能 -->
    <section class="hidden-xs">
    <ul class="cb-slideshow">
        <li><span>天若</span></li>
        <li><span>有情</span></li>
        <li><span>天亦老</span></li>
        <li><span>我为</span></li>
        <li><span>长者</span></li>
        <li><span>续一秒</span></li>
    </ul>
</section>
    <!-- 欧尼酱功能, 谁用谁知道 -->
    
    <header class="navbar navbar-inverse" id="gal-header">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target=".bs-navbar-collapse"
                    aria-expanded="false">
                <span class="fa fa-lg fa-reorder"></span>
            </button>
            <a href="https://laurence-042.github.io">
                
                <style>
                    #gal-header .navbar-brand {
                        height: 54px;
                        line-height: 24px;
                        font-size: 28px;
                        opacity: 1;
                        background-color: rgba(0,0,0,0);
                        text-shadow: 0 0 5px #fff,0 0 10px #fff,0 0 15px #fff,0 0 20px #228DFF,0 0 35px #228DFF,0 0 40px #228DFF,0 0 50px #228DFF,0 0 75px #228DFF;
                    }
                </style>
                <!-- 这里使用文字(navbar_text or config.title) -->
                <div class="navbar-brand">Laurence</div>
                
            </a>
        </div>
        <div class="collapse navbar-collapse bs-navbar-collapse">
            <ul class="nav navbar-nav" id="menu-gal">
                
                
                <li class="">
                    <a href="/">
                        <i class="fa fa-home"></i>首页
                    </a>
                </li>
                
                
                
                <li class="">
                    <a href="/archives">
                        <i class="fa fa-archive"></i>归档
                    </a>
                </li>
                
                
                
                
                <li class="">
                    <a href="/categories">
                        <i class="fa fa-list"></i>分类
                    </a>
                </li>
                
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-tags"></i>标签
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/tags/Java/">Java</a>
                        </li>
                        
                        <li>
                            <a href="/tags/笔记/">笔记</a>
                        </li>
                        
                        <li>
                            <a href="/tags/日常/">日常</a>
                        </li>
                        
                        <li>
                            <a href="/tags/纯记忆的学习笔记/">纯记忆的学习笔记</a>
                        </li>
                        
                        <li>
                            <a href="/tags/Python/">Python</a>
                        </li>
                        
                        <li>
                            <a href="/tags/不定期更新/">不定期更新</a>
                        </li>
                        
                        
                        <li>
                            <a href="/tags">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                <li class="">
                    <a href="/about">
                        <i class="fa fa-user"></i>关于我
                    </a>
                </li>
                
                
            </ul>
        </div>
    </div>
</header>
    <div id="gal-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 gal-right" id="mainstay">
                    
<article class="article well article-body" id="article">
    <div class="breadcrumb">
        <i class="fa fa-home"></i>
        <a href="https://laurence-042.github.io">Laurence</a>
        >
        <span>DFS,BFS学习笔记</span>
    </div>
    <!-- 大型设备详细文章 -->
    <div class="hidden-xs">
        <div class="title-article">
            <h1>
                <a href="/2018/07/22/DFS-BFS学习笔记/">DFS,BFS学习笔记</a>
            </h1>
        </div>
        <div class="tag-article">
            
            <span class="label label-gal">
                <i class="fa fa-tags"></i>
                
                <a href="/tags/Java/">Java</a>, 
                
                <a href="/tags/笔记/">笔记</a>
                
            </span>
            
            <span class="label label-gal">
                <i class="fa fa-calendar"></i> 2018-07-22
            </span>
            
        </div>
    </div>
    <!-- 小型设备详细文章 -->
    <div class="visible-xs">
        <center>
            <div class="title-article">
                <h4>
                    <a href="/2018/07/22/DFS-BFS学习笔记/">DFS,BFS学习笔记</a>
                </h4>
            </div>
            <p>
                <i class="fa fa-calendar"></i> 2018-07-22
            </p>
            <p>
                
                <i class="fa fa-tags"></i>
                
                <a href="/tags/Java/">Java</a>, 
                
                <a href="/tags/笔记/">笔记</a>
                
                
                
            </p>
        </center>
    </div>
    <div class="content-article">
        <p>基础的对图进行搜索的两种算法，自己敲一遍之后发现其实挺简单的，思路也很直观，但依然佩服想出来这个的家伙<br><a id="more"></a><br><em>本文是这个鶸在看完<a href="https://www.jianshu.com/p/70952b51f0c8" target="_blank" rel="noopener">@卡巴拉的树</a>的<a href="https://www.jianshu.com/p/70952b51f0c8" target="_blank" rel="noopener">图的基本算法（BFS和DFS）</a>后写出来的，那篇文章讲的很明了但代码注释不足（其实正文讲明白了也没多大写注释的必要），而且用的是C++，因此这个鶸就在练习性的用Java敲了一遍后顺便补上了注释写成了本文</em>  </p>
<h2 id="BFS：广度优先搜索算法"><a href="#BFS：广度优先搜索算法" class="headerlink" title="BFS：广度优先搜索算法"></a>BFS：广度优先搜索算法</h2><p>简单来说就是“哎呀我眼镜掉了”然后开始满地摸眼镜的过程。<br>先把身边的地方摸个遍顺便记下稍远处还没摸到的地方，身边摸不到的话再去刚刚记下的远处没摸到的地方继续摸，直到摸到为止。<br>注释很详细，就不多赘述了，上代码！  </p>
<pre><code class="Java">package com.Laurence_042.BFS;

import java.util.LinkedList;
import java.util.Queue;

public class Demo {
    // 先定义一个代表邻接矩阵的二维数组，忘记||不知道邻接矩阵的先去学离散数学再敲代码
    public static final int[][] MAZE = new int[][] { { 0, 1, 1, 0, 0 }, { 0, 0, 1, 1, 0 }, { 0, 1, 1, 1, 0 },
            { 1, 0, 0, 0, 0 }, { 0, 0, 1, 1, 0 } };
    // 再定义一个标记“已访问过的节点”的boolean数组
    boolean[] visited = new boolean[5];

    //没错，这玩意去掉注释才13条语句，而且还是算上里面的两条System.out.println()的结果
    private void BFS(int start) {
        /*
         * 顺便提前说一下Queue（队列）是个啥， Queue可以被看作一个水管，水从一边进从另一边出。
         * 也就是说，先加入的元素会先被取出来，和Stack（栈）正好相反。 
         * 元素出来的一侧叫做“头”，进去的一侧叫做“尾”。
         * 在Java里可以用offer()方法向尾部加入元素，用poll()方法从头部取出元素。
         * 注意：元素被“取出”代表着它从Queue脱离了，不再存在于Queue中
         */
        // 先定义一个Queue
        Queue&lt;Integer&gt; queue = new LinkedList&lt;&gt;();

        // 先将搜索起点加进Queue里
        queue.offer(start);
        System.out.println(&quot;offer:&quot; + start);

        // 只要Queue未空，就代表从起点进行的搜索还未完成
        while (!queue.isEmpty()) {
            // 在这个循环中，start变量代表”正在被访问的节点
            // 现在取出并访问start
            start = queue.poll();
            System.out.println(&quot;poll:&quot; + start);
            // 记下“start这个节点已经被访问过了”
            visited[start] = true;
            // do some thing
            // 这里的方法是访问节点是所需要执行的操作，毕竟想搜索什么东西肯定是准备要对它做点啥的对吧（笑）
            visit(start, queue, visited);

            for (int j = 0; j &lt; MAZE[start].length; j++) {
                // 将与“当前正在被访问的节点”邻接的所有未访问过的节点加到Queue中，
                // 准备以新的节点作为“当前正在被访问的节点”进行下一轮操作
                if (MAZE[start][j] == 1 &amp;&amp; !visited[j]) {
                    queue.offer(j);
                    System.out.println(&quot;offer:&quot; + j);
                    visited[j] = true;
                }
            }
        }
    }

    // 这是个演示方法，实际使用时把这个方法的内容替换为任意想对节点进行的操作即可
    private void visit(int node, Queue&lt;Integer&gt; queue, boolean[] visited) {
        System.out.println(&quot;-----------------------------------&quot;);
        System.out.println(&quot;visiting node: &quot; + node);
        System.out.print(&quot;now queue: {&quot;);
        for (int i = 0; i &lt; queue.size(); i++) {
            System.out.print(queue.toArray()[i]);
            if (i &lt; queue.size() - 1)
                System.out.print(&quot;,&quot;);
            else
                System.out.println(&quot;}&quot;);
        }
        System.out.print(&quot;now visited: {&quot;);
        for (int i = 0; i &lt; visited.length; i++) {
            System.out.print(visited[i]);
            if (i &lt; visited.length - 1)
                System.out.print(&quot;,&quot;);
            else
                System.out.println(&quot;}&quot;);
        }
        System.out.println(&quot;-----------------------------------&quot;);
    }

    public static void main(String[] args) {
        Demo demo = new Demo();
        for (int i = 0; i &lt; 5; i++) {
            if (demo.visited[i])
                continue;
            System.out.println(&quot;node &quot;+i+&quot; isn&#39;t visited, new BFS from node &quot;+i);
            demo.BFS(i);
        }

    }

}
</code></pre>
<p>运行结果：</p>
<pre><code>node 0 isn&#39;t visited, new BFS from node 0
offer:0
poll:0
-----------------------------------
visiting node: 0
now queue: {now visited: {true,false,false,false,false}
-----------------------------------
offer:1
offer:2
poll:1
-----------------------------------
visiting node: 1
now queue: {2}
now visited: {true,true,true,false,false}
-----------------------------------
offer:3
poll:2
-----------------------------------
visiting node: 2
now queue: {3}
now visited: {true,true,true,true,false}
-----------------------------------
poll:3
-----------------------------------
visiting node: 3
now queue: {now visited: {true,true,true,true,false}
-----------------------------------
node 4 isn&#39;t visited, new BFS from node 4
offer:4
poll:4
-----------------------------------
visiting node: 4
now queue: {now visited: {true,true,true,true,true}
-----------------------------------
</code></pre><h2 id="DFS：深度优先搜索算法"><a href="#DFS：深度优先搜索算法" class="headerlink" title="DFS：深度优先搜索算法"></a>DFS：深度优先搜索算法</h2><p>相对而言，深度优先的想法稍微不那么浅显了，嗯，没错，只是“稍微”不那么浅显而已，还是挺浅显的。<br>话说，你知道“二叉树”吗？用那个数据结构存储的数据查找起来还是挺快的，利用它的变种“红黑树”还能进一步提高查找事件的稳定性，不过这都是题外话了。我想说的是，“二叉树”的遍历算法和DFS有异曲同工之妙。简言之就是下面的思想：  </p>
<blockquote>
<p>1.我知道只有一个元素，或两个元素，甚至三个元素的时候该怎么做<br>2.这个问题的集合里有一堆的元素（比如遍历某个有向图里所有节点），我被搞糊涂了，不知道该怎么做<br>3.这个问题集合里的元素貌似可以进行相似的分割（比如有向图里所有节点可分为“当前节点”和“剩下的它旁边的节点”<br>4.那就对作为起始的随便一个“这个元素”执行某个方法，这样的话这个节点就被搞定了，剩下的节点就是下一次执行方法要处理的了（比如（访问当前结点，并对周围节点执行（访问当前结点，并对周围节点执行（访问当前结点，并对周围节点执行（······（<strong>whoops！</strong>）······）））））<br>5.这样下去总能再最深处（一堆括号的最内层）出现1.处的情况（没错就是那个 <strong>whoops！</strong>），也就是······这个问题可解了！然后这个“最内层的括号”就可以被打开，“次外层的括号”就变成了“最内层的括号”！这时候你只要继续下去，当最外层的括号也被解开的时候，问题解决了！<br><code>`</code>Java<br>package com.Laurence_042.DFS;</p>
</blockquote>
<p>public class Demo {<br>    // 先定义一个代表邻接矩阵的二维数组，忘记||不知道邻接矩阵的先去学离散数学再敲代码<br>    public static final int[][] MAZE = new int[][] { { 0, 1, 1, 0, 0 }, { 0, 0, 1, 1, 0 }, { 0, 1, 1, 1, 0 },<br>            { 1, 0, 0, 0, 0 }, { 0, 0, 1, 1, 0 } };<br>    // 再定义一个标记“已访问过的节点”的boolean数组<br>    boolean[] visited = new boolean[5];</p>
<pre><code>/*
 * 没错，这个算法更短，才5条语句（笑）
 * 这是个典型的递归思想：
 * 如果我只有一个节点，访问完这个节点就全部访问完了。
 * 如果这个节点旁边还有节点，就&quot;访问完这个节点&quot;后再对旁边的节点依次&quot;访问完这个节点&quot;，
 * 这样一直往深的访问总有到头的时候，这时候只要执行&quot;如果我只有一个节点&quot;时候的操作就万事大吉了
 * 
 * 简言之，大事化小，小事化了。不过除了递归的时候外，我平时都超烦这句话的（苦笑）
 */
private void DFS(int start) {
    visited[start]=true;
    visit(start, visited);
    for (int i = 0; i &lt; MAZE.length; i++) {
        if (MAZE[start][i] == 1 &amp;&amp; !visited[i])
            DFS(i);
    }
}

// 这是个演示方法，实际使用时把这个方法的内容替换为任意想对节点进行的操作即可
private void visit(int node, boolean[] visited) {
    System.out.println(&quot;-----------------------------------&quot;);
    System.out.println(&quot;visiting node: &quot; + node);
    System.out.print(&quot;now visited: {&quot;);
    for (int i = 0; i &lt; visited.length; i++) {
        System.out.print(visited[i]);
        if (i &lt; visited.length - 1)
            System.out.print(&quot;,&quot;);
        else
            System.out.println(&quot;}&quot;);
    }
    System.out.println(&quot;-----------------------------------&quot;);
}

public static void main(String[] args) {
    Demo demo = new Demo();
    for (int i = 0; i &lt; 5; i++) {
        if (demo.visited[i])
            continue;
        System.out.println(&quot;node &quot; + i + &quot; isn&#39;t visited, new DFS from node &quot; + i);
        demo.DFS(i);
    }

}
</code></pre><p>}</p>
<pre><code>运行结果：
</code></pre><h2 id="node-0-isn’t-visited-new-DFS-from-node-0"><a href="#node-0-isn’t-visited-new-DFS-from-node-0" class="headerlink" title="node 0 isn’t visited, new DFS from node 0"></a>node 0 isn’t visited, new DFS from node 0</h2><p>visiting node: 0</p>
<h2 id="now-visited-true-false-false-false-false"><a href="#now-visited-true-false-false-false-false" class="headerlink" title="now visited: {true,false,false,false,false}"></a>now visited: {true,false,false,false,false}</h2><hr>
<p>visiting node: 1</p>
<h2 id="now-visited-true-true-false-false-false"><a href="#now-visited-true-true-false-false-false" class="headerlink" title="now visited: {true,true,false,false,false}"></a>now visited: {true,true,false,false,false}</h2><hr>
<p>visiting node: 2</p>
<h2 id="now-visited-true-true-true-false-false"><a href="#now-visited-true-true-true-false-false" class="headerlink" title="now visited: {true,true,true,false,false}"></a>now visited: {true,true,true,false,false}</h2><hr>
<p>visiting node: 3</p>
<h2 id="now-visited-true-true-true-true-false"><a href="#now-visited-true-true-true-true-false" class="headerlink" title="now visited: {true,true,true,true,false}"></a>now visited: {true,true,true,true,false}</h2><h2 id="node-4-isn’t-visited-new-DFS-from-node-4"><a href="#node-4-isn’t-visited-new-DFS-from-node-4" class="headerlink" title="node 4 isn’t visited, new DFS from node 4"></a>node 4 isn’t visited, new DFS from node 4</h2><p>visiting node: 4</p>
<h2 id="now-visited-true-true-true-true-true"><a href="#now-visited-true-true-true-true-true" class="headerlink" title="now visited: {true,true,true,true,true}"></a>now visited: {true,true,true,true,true}</h2><p><code>`</code><br>So······这个才5条语句，这么好写而且输出结果没啥问题，为啥不只用DFS还要学BFS呢?<br>Well,这个是递归，有向图越大，它到达“最内层”花的时间就越长，更麻烦的是，随着调用层数的增加，调用外层时消耗掉内存无法被释放，因此当有向图大到一定程度时，这个算法会花大量时间占满内存而最后一个解都弄不出来并随着一句“内存满了”而异常终止。<br>那为啥不只学BFS呢？<br>拜托，你如果只是解个自行车的追及问题（小范围问题）还有必要用相对论的时空相对性（保险但麻烦的算法）嘛？（笑）<br><!--more--></p>

    </div>
</article>


<div id="comments-template"></div>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script>
	if(!window.commentConfig) {
      window.commentConfig = {}
      window.commentConfig.title = 'DFS,BFS学习笔记'
    }
</script>

                </div>
                <aside class="col-md-4 gal-left" id="sidebar">
    <!-- 此为sidebar的搜索框, 非搜索结果页面 -->
<aside id="sidebar-search">
    <div class="search hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <form class="form-inline clearfix" id="search-form" method="get"
              action="/search/index.html">
            <input type="text" name="s" class="form-control" id="searchInput" placeholder="搜索文章~">
            <button class="btn btn-danger btn-gal" type="submit">
                <i class="fa fa-search"></i>
            </button>
        </form>
    </div>
</aside>
    <aside id="sidebar-author">
    <div class="panel panel-gal" data-aos="flip-right" data-aos-duration="3000">
        <div class="panel-heading" style="text-align: center">
            <i class="fa fa-quote-left"></i>
            Laurence-042
            <i class="fa fa-quote-right"></i>
        </div>
        <div class="author-panel text-center">
            <img src="/imgs/dr.png" width="140" height="140"
                 alt="个人头像" class="author-image">
            <p class="author-description"></p>
        </div>
    </div>
</aside>
    
    <aside id="sidebar-recent_comments">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-comments"></i>
            最新评论
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush"></ul>
    </div>
</aside>
    
    <!-- 要配置好leancloud才能开启此小工具 -->
    
    
    <aside id="sidebar-recent_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            近期文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/10/08/一个鶸的自我修养/">一个鶸的自我修养</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/10/08/hello-world/">Hello World</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/08/08/给真·小白的关于初用远程Linux系统的简单入门/">给真·小白的关于初用远程Linux系统的简单入门</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/08/02/令新人各种懵逼的各种概念/">令新人各种懵逼的各种概念</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/31/Python-MySQL数据查询/">Python-MySQL数据查询</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/28/Python笔记-这个鶸仍未搞明白的东西/">Python笔记-这个鶸仍未搞明白的东西</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/26/Python笔记-特殊变量/">Python笔记-特殊变量</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/25/Fullmetal Alchemist!!!/">Fullmetal Alchemist!!!</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/23/Python笔记-陌生的lambda/">Python笔记-陌生的lambda</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/22/DFS-BFS学习笔记/">DFS,BFS学习笔记</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="sidebar-rand_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            随机文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/25/Fullmetal Alchemist!!!/">Fullmetal Alchemist!!!</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/07/JavaDoc语法/">JavaDoc语法</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/31/Python-MySQL数据查询/">Python-MySQL数据查询</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/26/Python笔记-特殊变量/">Python笔记-特殊变量</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/10/08/hello-world/">Hello World</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/10/08/一个鶸的自我修养/">一个鶸的自我修养</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/08/02/令新人各种懵逼的各种概念/">令新人各种懵逼的各种概念</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/09/关于Java实现的某些算法的记录/">关于Java实现的某些算法的记录</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/06/30/文字处理工具（不定期更新）/">文字处理工具（不定期更新）</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/09/用bat文件简化hexo操作/">用bat文件简化hexo操作</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="gal-sets">
        <div class="panel panel-gal hidden-xs" data-aos="fade-up" data-aos-duration="2000">
            <ul class="nav nav-pills pills-gal">
                <li class="">
                    <a href="/2018/07/22/DFS-BFS学习笔记/index.html#sidebar-tags" data-toggle="tab" id="tags-tab">热门标签</a>
                </li>
                <li class="">
                    <a href="/2018/07/22/DFS-BFS学习笔记/index.html#sidebar-friend-links" data-toggle="tab" id="friend-links-tab">友情链接</a>
                </li>
                <li class="">
                    <a href="/2018/07/22/DFS-BFS学习笔记/index.html#sidebar-links" data-toggle="tab" id="links-tab">个人链接</a>
                </li>
            </ul>
            <div class="tab-content">
                <div class="cloud-tags tab-pane nav bs-sidenav fade" id="sidebar-tags">
    
    <a href="/tags/Java/" style="font-size: 10.37362404852944px;" class="tag-cloud-link">Java</a>
    
    <a href="/tags/笔记/" style="font-size: 10.95927565338693px;" class="tag-cloud-link">笔记</a>
    
    <a href="/tags/日常/" style="font-size: 18.1973762603427px;" class="tag-cloud-link">日常</a>
    
    <a href="/tags/纯记忆的学习笔记/" style="font-size: 15.41344264164103px;" class="tag-cloud-link">纯记忆的学习笔记</a>
    
    <a href="/tags/Python/" style="font-size: 14.83210025252276px;" class="tag-cloud-link">Python</a>
    
    <a href="/tags/不定期更新/" style="font-size: 11.042189462110144px;" class="tag-cloud-link">不定期更新</a>
    
    <a href="/tags/hey/" style="font-size: 18.786415972637464px;" class="tag-cloud-link">hey!</a>
    
    <a href="/tags/报错解决方案/" style="font-size: 10.855069998996012px;" class="tag-cloud-link">报错解决方案</a>
    
    <a href="/tags/MySQL/" style="font-size: 10.682878629550302px;" class="tag-cloud-link">MySQL</a>
    
    <a href="/tags/服务器/" style="font-size: 14.588167586953102px;" class="tag-cloud-link">服务器</a>
    
    <a href="/tags/工具/" style="font-size: 16.294985847888803px;" class="tag-cloud-link">工具</a>
    
    <a href="/tags/hexo/" style="font-size: 13.416920064257027px;" class="tag-cloud-link">hexo</a>
    
    <a href="/tags/bat/" style="font-size: 14.49260121522417px;" class="tag-cloud-link">bat</a>
    
    <a href="/tags/偷懒/" style="font-size: 14.98697352196379px;" class="tag-cloud-link">偷懒</a>
    
    <a href="/tags/真·小白/" style="font-size: 8.870360460534616px;" class="tag-cloud-link">真·小白</a>
    
    <a href="/tags/Linux/" style="font-size: 8.031028530141203px;" class="tag-cloud-link">Linux</a>
    
</div>
                <div class="friend-links tab-pane nav bs-sidenav fade" id="sidebar-friend-links">
    
    <li>
        <a href="http://kdays.net/days/" target="_blank">KDays Forum</a>
    </li>
    
    <li>
        <a href="http://www.gal123.com/" target="_blank">绅士导航♂</a>
    </li>
    
    <li>
        <a href="http://www.moe123.com/" target="_blank">萌导航</a>
    </li>
    
    <li>
        <a href="https://google.jiongjun.cc/" target="_blank">Google镜像站</a>
    </li>
    
</div>
                <div class="links tab-pane nav bs-sidenav fade" id="sidebar-links">
    
    <li>
        <a href="https://github.com/Laurence-042" target="_blank">Github</a>
    </li>
    
    <li>
        <a href="http://localhost:4000/" target="_blank">null,没有更多的了</a>
    </li>
    
</div>
            </div>
        </div>
    </aside>
    
</aside>
            </div>
        </div>
    </div>
    <footer id="gal-footer">
    <div class="container">
        Copyright © 2018 Laurence-042 Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>.&nbsp;Theme by <a href="https://github.com/ZEROKISEKI" target="_blank">AONOSORA</a>
    </div>
</footer>

<!-- 回到顶端 -->
<div id="gal-gotop">
    <i class="fa fa-angle-up"></i>
</div>
</body>
<script src="/js/activate-power-mode.js"></script>
<script>

    // 配置highslide
	hs.graphicsDir = '/js/highslide/graphics/'
    hs.outlineType = "rounded-white";
    hs.dimmingOpacity = 0.8;
    hs.outlineWhileAnimating = true;
    hs.showCredits = false;
    hs.captionEval = "this.thumb.alt";
    hs.numberPosition = "caption";
    hs.align = "center";
    hs.transitions = ["expand", "crossfade"];
    hs.lang.number = '共%2张图, 当前是第%1张';
    hs.addSlideshow({
      interval: 5000,
      repeat: true,
      useControls: true,
      fixedControls: "fit",
      overlayOptions: {
        opacity: 0.75,
        position: "bottom center",
        hideOnMouseOut: true
      }
    })

    // 初始化aos
    AOS.init({
      duration: 1000,
      delay: 0,
      easing: 'ease-out-back'
    });

</script>
<script>
	POWERMODE.colorful = 'true';    // make power mode colorful
	POWERMODE.shake = 'true';       // turn off shake
	// TODO 这里根据具体情况修改
	document.body.addEventListener('input', POWERMODE);
</script>
<script>
    window.slideConfig = {
      prefix: '/imgs/slide/background',
      ext: 'jpg',
      maxCount: '6'
    }
</script>
<script src="/js/hs.js"></script>
<script src="/js/blog.js"></script>



<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
    if(window.commentConfig) {
      window.commentConfig.id = 'Sun Jul 22 2018 11:18:21 GMT+0000'
      window.commentConfig.owner = 'Laurence-042'
      window.commentConfig.repo = 'blog-comment'
      window.commentConfig.client_id = '41ecdf7be074fb66a1a2'
      window.commentConfig.client_secret = '2382f17284dc9ba9754020431735338ce8d80ec0'
      window.commentConfig.redirect_uri = ''
    } else {
      window.commentConfig = {
      	id: 'Sun Jul 22 2018 11:18:21 GMT+0000',
        owner: 'Laurence-042',
        repo: 'blog-comment',
        client_id: '41ecdf7be074fb66a1a2',
        client_secret: '2382f17284dc9ba9754020431735338ce8d80ec0',
        redirect_uri: ''
      }
    }
</script>

<!--highlight.js-->
<script>
    hljs.initHighlightingOnLoad();
</script>
<script src="/js/comment/gitment.js"></script>

</html>